package cn.sjlink.barcode.controller;

import cn.sjlink.store.service.ShopSiteService;
import cn.sjlink.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin("*")
@RestController
@RequestMapping("/barcode")
public class BarcodeController {
    @Autowired
    private ShopSiteService shopSiteService;

    @RequestMapping(value = "getBarcode",method = RequestMethod.GET)
    public Result getBarcode(String stackNo){
        try {
            return shopSiteService.getBarcode(stackNo);
        } catch (Exception e) {
            return new Result(false,"获取失败，请重试");
        }
    }
    @RequestMapping(value = "appBarcode",method = RequestMethod.GET)
    public Result appBarcode(String stackNo){
        return shopSiteService.appBarcode(stackNo);
    }

}
